﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:maps="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps"
    xmlns:tilt="clr-namespace:ControlTiltEffect"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
    x:Class="Mapping_Demo.MainPage"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent" Loaded="LoadIcons">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>                     
        </Grid.RowDefinitions>

        <!-- LOCALIZATION NOTE:
            To localize the displayed strings copy their values to appropriately named
            keys in the app's neutral language resource file (AppResources.resx) then
            replace the hard-coded text value between the attributes' quotation marks
            with the binding clause whose path points to that string name.

            For example:

                Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}"

            This binding points to the template's string resource named "ApplicationTitle".

            Adding supported languages in the Project Properties tab will create a
            new resx file per language that can carry the translated values of your
            UI strings. The binding in these examples will cause the value of the
            attributes to be drawn from the .resx file that matches the
            CurrentUICulture of the app at run time.
         -->

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
        	<TextBlock x:Name="charDisplay" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" FontFamily="Segoe WP Light" Text="Maps &amp; Geolocation" FontSize="51.333"/>
        </StackPanel>

    	<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,117">
    		<Grid.RowDefinitions>
    			<RowDefinition Height="265*"/>
    			<RowDefinition Height="265*"/>
    		</Grid.RowDefinitions>
    		<Grid.ColumnDefinitions>
    			<ColumnDefinition Width="229*"/>
    			<ColumnDefinition Width="227*"/>
    		</Grid.ColumnDefinitions>
    		<!-- tilt:TiltEffect.IsTiltEnabled="True"  -->
        <Button BorderThickness="0" 
                tilt:TiltEffect.IsTiltEnabled="True"
                    
                    HorizontalContentAlignment="Stretch" 
                    VerticalContentAlignment="Stretch" 
                    Padding="0">
    			<i:Interaction.Triggers>
    				<i:EventTrigger EventName="Click">
    					<ec:NavigateToPageAction TargetPage="/Views/SimpleDistance.xaml"/>
    				</i:EventTrigger>
    			</i:Interaction.Triggers>
    			<Grid Background="#FFEC5423">
    				<Canvas Margin="-11,-13,11,13" RenderTransformOrigin="0.5,0.5">
    					<Canvas.RenderTransform>
    						<CompositeTransform ScaleX="0.8" ScaleY="0.8"/>
    					</Canvas.RenderTransform>
    					<Ellipse HorizontalAlignment="Left" Height="100" Stroke="White" VerticalAlignment="Top" Width="100" StrokeThickness="6"/>
    					<Ellipse Fill="White" Height="30" Width="30" StrokeThickness="0" Canvas.Left="35" Canvas.Top="35" />
    					<Canvas x:Name="rotateCanvas" RenderTransformOrigin="0.5,0.5" Width="100" Height="100">
    						<Canvas.RenderTransform>
    							<CompositeTransform/>
    						</Canvas.RenderTransform>
    						<Path x:Name="aniPoly1" Data="M0,0 L50,0 L25,25" Fill="White" 
    							HorizontalAlignment="Left" 
    							Height="6" 
    							Stretch="Fill" 
    							Stroke="Black" 
    							StrokeThickness="0" 
    							UseLayoutRounding="False" Width="12" Canvas.Left="44" Canvas.Top="5"/>
    						<Path x:Name="aniPoly2" Data="M0,10 L5,5 L0,0" Fill="White" 
    							HorizontalAlignment="Left" 
    							Height="12" 
    							Stretch="Fill" 
    							Stroke="Black" 
    							StrokeThickness="0" 
    							UseLayoutRounding="False" Width="6" Canvas.Left="5" Canvas.Top="44"/>
    						<Path x:Name="aniPoly3" Data="M10,10 L5,0 L0,10" Fill="White" 
    							HorizontalAlignment="Left" 
    							Height="6" 
    							Stretch="Fill" 
    							Stroke="Black" 
    							StrokeThickness="0" 
    							UseLayoutRounding="False" Width="12" Canvas.Left="44" Canvas.Top="90"/>
    						<Path x:Name="aniPoly4" Data="M10,0 L5,5 L10,10" Fill="White" 
    							HorizontalAlignment="Left" 
    							Height="12" 
    							Stretch="Fill" 
    							Stroke="Black" 
    							StrokeThickness="0" 
    							UseLayoutRounding="False" Width="6" Canvas.Left="90" Canvas.Top="44"/>
    					</Canvas>
    					<Path Data="M50.625,48.625 L185.625,166.125" Fill="White" Height="98.75" Canvas.Left="50.625" Stretch="Fill" Stroke="White" StrokeThickness="6" Canvas.Top="48.625" UseLayoutRounding="False" Width="136.25"/>
    				</Canvas>
    				<Canvas Margin="98,62,-98,-62" RenderTransformOrigin="0.5,0.5">
    					<Canvas.RenderTransform>
    						<CompositeTransform ScaleX="0.8" ScaleY="0.8"/>
    					</Canvas.RenderTransform>
    					<Ellipse HorizontalAlignment="Left" Height="100" Stroke="White" VerticalAlignment="Top" Width="100" StrokeThickness="6"/>
    					<Ellipse Fill="White" Height="30" Width="30" StrokeThickness="0" Canvas.Left="35" Canvas.Top="35" />
    					<Canvas x:Name="rotateCanvas1" RenderTransformOrigin="0.5,0.5" Width="100" Height="100">
    						<Canvas.RenderTransform>
    							<CompositeTransform/>
    						</Canvas.RenderTransform>
    						<Path x:Name="aniPoly5" Data="M0,0 L50,0 L25,25" Fill="White" 
    							HorizontalAlignment="Left" 
    							Height="6" 
    							Stretch="Fill" 
    							Stroke="Black" 
    							StrokeThickness="0" 
    							UseLayoutRounding="False" Width="12" Canvas.Left="44" Canvas.Top="5"/>
    						<Path x:Name="aniPoly6" Data="M0,10 L5,5 L0,0" Fill="White" 
    							HorizontalAlignment="Left" 
    							Height="12" 
    							Stretch="Fill" 
    							Stroke="Black" 
    							StrokeThickness="0" 
    							UseLayoutRounding="False" Width="6" Canvas.Left="5" Canvas.Top="44"/>
    						<Path x:Name="aniPoly7" Data="M10,10 L5,0 L0,10" Fill="White" 
    							HorizontalAlignment="Left" 
    							Height="6" 
    							Stretch="Fill" 
    							Stroke="Black" 
    							StrokeThickness="0" 
    							UseLayoutRounding="False" Width="12" Canvas.Left="44" Canvas.Top="90"/>
    						<Path x:Name="aniPoly8" Data="M10,0 L5,5 L10,10" Fill="White" 
    							HorizontalAlignment="Left" 
    							Height="12" 
    							Stretch="Fill" 
    							Stroke="Black" 
    							StrokeThickness="0" 
    							UseLayoutRounding="False" Width="6" Canvas.Left="90" Canvas.Top="44"/>
    					</Canvas>
    				</Canvas>
    				<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="Distance Between 2 GeoCoordinates" VerticalAlignment="Bottom" Margin="0,0,0,12" FontSize="21.333" Width="176" TextAlignment="Center"/>
    			</Grid>
    		</Button>
        <Button BorderThickness="0" 
        	tilt:TiltEffect.IsTiltEnabled="True"
                    
        	HorizontalContentAlignment="Stretch" 
        	VerticalContentAlignment="Stretch" 
        	Padding="0" Grid.Column="1">
        	<i:Interaction.Triggers>
        		<i:EventTrigger EventName="Click">
        			<ec:NavigateToPageAction TargetPage="/Views/ReverseGeoCode.xaml"/>
        		</i:EventTrigger>
        	</i:Interaction.Triggers>
        	<Grid Background="#FF7CBC06">
        		<Grid.RowDefinitions>
        			<RowDefinition/>
        			<RowDefinition Height="Auto"/>
        		</Grid.RowDefinitions>
        		<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="Address From Point (Reverse Geocode)" VerticalAlignment="Bottom" Margin="7,0,6,12" FontSize="21.333" TextAlignment="Center" Grid.Row="1"/>
        		<Path x:Name="path" Data="M121.886,376.824l8.986-172.544c44.271-11.708,76.95-51.916,76.95-99.869C207.822,47.299,161.529,1,104.411,1    S1,47.299,1,104.411c0,47.557,32.133,87.502,75.839,99.584l9.003,172.891c-33.307,1.983-58.013,9.176-58.013,17.776    c0,10.126,34.257,18.335,76.521,18.335c42.253,0,76.516-8.209,76.516-18.335C180.865,385.978,155.673,378.724,121.886,376.824z     M90.189,81.628c-6.086,16.463-22.772,25.466-37.28,20.101C38.402,96.37,31.573,78.677,37.665,62.214    c6.085-16.469,22.772-25.471,37.273-20.112C89.451,47.467,96.28,65.159,90.189,81.628z" HorizontalAlignment="Center" Height="100" Margin="0" Stretch="Fill" Stroke="White" UseLayoutRounding="False" VerticalAlignment="Center" Width="50" StrokeThickness="0.5" RenderTransformOrigin="0.5,0.5">
        			<Path.Fill>
        				<SolidColorBrush Color="White"/>
        			</Path.Fill>
        		</Path>
        	</Grid>
        </Button>
        <Button BorderThickness="0" 
        	tilt:TiltEffect.IsTiltEnabled="True"                    
        	HorizontalContentAlignment="Stretch" 
        	VerticalContentAlignment="Stretch" 
        	Padding="0" Grid.Row="1"
            Click="NavToScavengerHunt">
        	<i:Interaction.Triggers>
        		<i:EventTrigger EventName="Click">
        			<ec:NavigateToPageAction TargetPage="/Views/ScavengerHunt.xaml"/>
        		</i:EventTrigger>
        	</i:Interaction.Triggers>
        	<Grid Background="#FF529CF0">
        		<Grid.ColumnDefinitions>
        			<ColumnDefinition Width="10*"/>
        			<ColumnDefinition Width="10*"/>
        		</Grid.ColumnDefinitions>
        		<Grid.RowDefinitions>
        			<RowDefinition Height="100*"/>
        			<RowDefinition Height="100*"/>
        			<RowDefinition Height="Auto"/>
        		</Grid.RowDefinitions>
        		<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="Scavenger Hunt(Mapping Routes)" VerticalAlignment="Bottom" Margin="16,0,15,12" FontSize="21.333" TextAlignment="Center" Grid.Row="2" Grid.ColumnSpan="2"/>
        		<Image Margin="6" Source="/Assets/LocationIcons/LocationIcon2.png"/>
        		<Image Margin="6" Source="/Assets/LocationIcons/LocationIcon3.png" Grid.Row="1"/>
        		<Image Margin="6" Source="/Assets/LocationIcons/LocationIcon5.png" Grid.Column="1"/>
        		<Image Margin="6" Source="/Assets/LocationIcons/LocationIcon6.png" Grid.Row="1" Grid.Column="1"/>
        	</Grid>
        </Button>
        <Button BorderThickness="0" 
        	tilt:TiltEffect.IsTiltEnabled="True"
                    
        	HorizontalContentAlignment="Stretch" 
        	VerticalContentAlignment="Stretch" 
        	Padding="0" Grid.Column="1" Grid.Row="1">
        	<i:Interaction.Triggers>
        		<i:EventTrigger EventName="Click">
        			<ec:NavigateToPageAction TargetPage="/Views/IsMapOffline.xaml"/>
        		</i:EventTrigger>
        	</i:Interaction.Triggers>
        	<Grid Background="#FFFFBB00">
        		<Grid.RowDefinitions>
        			<RowDefinition/>
        			<RowDefinition Height="Auto"/>
        		</Grid.RowDefinitions>
        		<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="Offline Maps" VerticalAlignment="Bottom" Margin="7,0,6,12" FontSize="21.333" TextAlignment="Center" Grid.Row="1"/>
        		<Image Margin="12,0" Source="/Assets/NoCloud.png" HorizontalAlignment="Center" VerticalAlignment="Center"/>
        	</Grid>
        </Button>
    	</Grid>

        <!--Uncomment to see an alignment grid to help ensure your controls are
            aligned on common boundaries.  The image has a top margin of -32px to
            account for the System Tray. Set this to 0 (or remove the margin altogether)
            if the System Tray is hidden.

            Before shipping remove this XAML and the image itself.-->
        <!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />-->
    </Grid>

</phone:PhoneApplicationPage>